<%@ Page Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="QueryOrder.aspx.cs" Inherits="EditOrder" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderAdmin" Runat="Server">

<table cellpadding="10">
    <tr>
        <td colspan="5">
            <h3 id="title">List orders to day</h3>
        </td>
    </tr>
    <tr>
        <td colspan="5">
            <asp:GridView ID="GVOrder" runat="server" AutoGenerateColumns="False" DataSourceID="OdsOrder"
                        DataKeyNames="OrderID" Height="1px" OnSelectedIndexChanged="GVOrder_SelectedIndexChanged" CellPadding="4" ForeColor="#333333" GridLines="None">
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="OrderID" HeaderText="OrderID" SortExpression="OrderID" />
                    <asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName" />
                    <asp:BoundField DataField="ShipID" HeaderText="ShipID" SortExpression="ShipID" />
                    <asp:BoundField DataField="OrderDate" HeaderText="OrderDate" SortExpression="OrderDate" />
                    <asp:BoundField DataField="RequireDate" HeaderText="RequireDate" SortExpression="RequireDate" />
                    <asp:BoundField DataField="ShippedDate" HeaderText="ShippedDate" SortExpression="ShippedDate" />
                    <asp:BoundField DataField="ShipName" HeaderText="ShipName" SortExpression="ShipName" />
                    <asp:BoundField DataField="ShipAddress" HeaderText="ShipAddress" SortExpression="ShipAddress" />
                    <asp:BoundField DataField="ShipCity" HeaderText="ShipCity" SortExpression="ShipCity" />
                    <asp:BoundField DataField="SubTotal" HeaderText="SubTotal" SortExpression="SubTotal" />
                </Columns>
                   <RowStyle BackColor="#E3EAEB" />
                   <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                   <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                   <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                   <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                   <EditRowStyle BackColor="#7C6F57" />
               <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
        </td>
    </tr>
    <tr style="text-align:right">
        <td colspan="5">
            <p style="padding-right:30px"><b>Total(usd) : <asp:Label ID="lblTotal" runat="server" ForeColor="red" /></b></p>
        </td>
    </tr>
    <tr>
        <td style="width: 120px; vertical-align:top">
            Enter day from : 
        </td>
        <td style="width: 150px">
            <asp:TextBox ID="txtDayfrom" runat="server" /><br />
            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtDayfrom"
                ErrorMessage="Day format incorrect" Operator="DataTypeCheck" Type="Date" ValueToCompare="mm/dd/yyyy" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtDayfrom" ErrorMessage="*" />
        </td>
        <td style="width: 120px; vertical-align:top">
            Enter day to :
        </td>
        <td>
             <asp:TextBox ID="txtDayto" runat="server" /> <asp:Button ID="btnsearchOrder" runat="server" OnClick="btnsearchOrder_Click" Text="View" /><br />
             <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="txtDayto" 
                                    ErrorMessage="Day format inccorect" Operator="DataTypeCheck"  Type="Date" ValueToCompare="mm/dd/yyyy" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDayto" ErrorMessage="*" />                            
        </td>
        <td style="text-align:left; vertical-align:top" >
            
        </td>
    </tr>
</table>
   
    <asp:ObjectDataSource ID="OdsOrder" runat="server" SelectMethod="GetByOrderDate" TypeName="Bll.OrderBll" />    
    
<table>
    <tr>
        <td>
            <asp:GridView ID="GVOrderView" runat="server" DataKeyNames="OrderID" DataSourceID="OdsorderView" OnSelectedIndexChanged="GVOrderView_SelectedIndexChanged" CellPadding="4" ForeColor="#333333" GridLines="None">
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                </Columns>
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>            
        </td>
    </tr>
    <tr>
        <td style="text-align:right">
            <p style="padding-right:30px"><b>Total(usd) : <asp:Label ID="lblTotalSearchOrder" runat="server" ForeColor="Red" /></b></p>
        </td>
    </tr>
</table>

    <asp:ObjectDataSource ID="OdsorderView" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetOrderBetweenDay" TypeName="Bll.OrderBll">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtDayfrom" DefaultValue="2009/04/12" Name="from"
                PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="txtDayto" DefaultValue="2009/05/12" Name="to" PropertyName="Text"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
</asp:Content>

